use "brazil_census1872.dta"
generate pardofree = (fpardo+fparda)/(fpardo+fparda+slvpardo+slvparda)
generate logpop = log(freeall+slvall)
generate mshare = (freemen+slvmen)/(freeall+slvall)
generate whiteshare = (fbranco+fbranca)/(freeall+slvall)
generate nativeshare = (fcaboclos+fcaboclas)/(freeall+slvall)
generate literacy = (flitmen+flitwomen+slvlitmen+slvlitwomen)/(freeall+slvall)
generate slaveshare = (slvall)/(freeall+slvall)
generate slavestate = 1 if region=="Southeast"|region=="Northeast"|region=="Central"
generate pardoslave = 1-pardofree
replace slavestate = 0 if region=="North"|region=="South"
generate notsouth = 1 if slavestate==1|region=="North"
replace notsouth = 0 if region=="South"
*Graph for Figure 4
binscatter pardoslave whiteshare, controls(slaveshare mshare) xlab(, nogrid) ylab(, nogrid)
*Results for Appendix Table D.7
reg pardoslave slavestate whiteshare mshare logpop nativeshare literacy slaveshare,r
reg pardoslave notsouth whiteshare mshare logpop nativeshare literacy slaveshare,r
